package com.sywl.util;

import org.hibernate.classic.Session;

import com.sywl.contact.form.Contact;

public class ContactManager {
	
	public static void main(String[] args) {
		ContactManager cmr=new ContactManager();
		
		cmr.createAndStoreContact("fffff");
	}

	private void createAndStoreContact(String firstname){
		Session session=HibernateUtil.getSessionFactory().getCurrentSession();
		session.beginTransaction();
		
		Contact c=new Contact();
		c.setFirstname(firstname);
		session.save(c);
		session.getTransaction().commit();
		System.out.println("ok!!!");
	}
}
